package com.objectproject.main.service.subsystem.loader;

import java.util.ArrayList;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.objectproject.main.dao.MyPropertyDAOImpl;
import com.objectproject.main.dao.MyPropertyHierarchyDAOImpl;
import com.objectproject.main.model.MyObject;
import com.objectproject.main.service.subsystem.MyObjectHierarchyResolver;

@Service
public class AncestorObjectLoader {
	
	@Autowired
	MyPropertyDAOImpl myPropertyDAOImpl;
	
	@Autowired
	MyObjectHierarchyResolver myObjectHierarchyResolver;
	
	@Autowired
	MyPropertyHierarchyDAOImpl myPropertyHierarchyDAOImpl;
	
	//semantic overriding version properties retriever method
	
	public void loadAncestorObjects(MyObject myObject){
		
		ArrayList<MyObject> ancestorObjects = myObjectHierarchyResolver.getAncestorObjectsOf(myObject);
	
		myObject.setSuperObjects(ancestorObjects);
		
	}
	
	
	public void loadAncestorObjectsWithDepthOrdering(MyObject myObject){
		
		ArrayList<MyObject> ancestorObjects = myObjectHierarchyResolver.getAncestorObjectsOf(myObject);
		
		//콜렉션 정렬 넣기
		
		myObject.setSuperObjects(ancestorObjects);
		
	}
	
	
}
